﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class JourneyOrder
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _type = string.Empty;
        [DataMember]
        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        private string _ref = string.Empty;
        [DataMember]
        public string Ref
        {
            get { return _ref; }
            set { _ref = value; }
        }

        private string _status = "可用";
        [DataMember]
        public string Status
        {
            get { return _status; }
            set { _status = value; }
        }

        private string _passenger = string.Empty;
        [DataMember]
        public string Passenger
        {
            get { return _passenger; }
            set { _passenger = value; }
        }

        private string _ticketNo = string.Empty;
        [DataMember]
        public string TicketNo
        {
            get { return _ticketNo; }
            set { _ticketNo = value; }
        }

        private DateTime? _usedDate;
        [DataMember]
        public DateTime? UsedDate
        {
            get { return _usedDate; }
            set { _usedDate = value; }
        }

        //private bool _isDelete = false;
        //[DataMember]
        //public bool IsDelete
        //{
        //    get { return _isDelete; }
        //    set { _isDelete = value; }
        //}

        public override bool Equals(object obj)
        {
            JourneyOrder temp = obj as JourneyOrder;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }

        public override string ToString()
        {
            return Ref;
        }
    }
}
